package com.aind.member.service.impl;

import com.aind.member.dao.MemberIndustriesMapper;
import com.aind.member.model.MemberIndustries;
import com.aind.member.service.IMemberIndustriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by lpeng on 2017/3/17.
 */
@Service
public class MemberIndustriesService implements IMemberIndustriesService {

    @Autowired
    private MemberIndustriesMapper mapper;

    @Override
    @Transactional
    public void saveMemberIndustriesList(List<MemberIndustries> list) {
        for (MemberIndustries industries : list) {
            mapper.insert(industries);
        }
    }

    @Override
    @Transactional
    public void save(MemberIndustries industries) {
        mapper.insert(industries);
        int i = 1/0;
        mapper.insert(industries);
    }
}
